<?php
namespace app\admin\controller;

use app\common\lib\redis\Predis;

class Live
{
    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function push()
    {
        $teams = [
            1 => [
                'name' => '马刺',
                'logo' => '/live/imgs/team1.png'
            ],
            4 => [
                'name' => '火箭',
                'logo' => '/live/imgs/team2.png'
            ]
        ];
        $data  = [
            'type' => '第'.$_GET['type'].'节',
            'team' => !empty($teams[$_GET['team_id']]['name']) ? $teams[$_GET['team_id']]['name'] : '直播员',
            'logo' => !empty($teams[$_GET['team_id']]['logo']) ? $teams[$_GET['team_id']]['logo'] : '',
            'content' => !empty($_GET['content']) ? $_GET['content'] : '直播员还没有说话',
            'image' => !empty($_GET['image']) ? $_GET['image'] : ''
        ];
//        print_r($data);
        $postData = [
            'method' => 'push_live',
            'data' => $data
        ];
        $_POST['http_server']->task($postData);
    }
}
